<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<%String strBackUrl = "http://" + request.getServerName() //服务器地址  
+ ":"   
+ request.getServerPort()+"/user";    %>
<html>
<head>
	<title>信息查看</title>
	<meta name="decorator" content="default"/>
	<link href="${ctxStatic}/file/css/fileinput.css"  rel="stylesheet" type="text/css" />  
	<script src="${ctxStatic}/file/js/fileinput.min.js" type="text/javascript"></script>  
	 <script src="${ctxStatic}/file/js/fileinput_locale_zh.js" type="text/javascript"></script> 
	<script type="text/javascript">
		$(document).ready(function() {
			//$("#name").focus();
			$("#inputForm").validate({
				submitHandler: function(form){
					loading('正在提交，请稍等...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
		});
		function chong(){
			var b=$("#did").val();//获取当前用户重新赋值
		    $(':input,#inputForm')  
	         .not(':button, :submit, :reset, :hidden')  
	         .val('')  
	         .removeAttr('checked')  
	         .removeAttr('selected');   
		    $("#did").val(b);
		}

		
		
		function shang(){
			$('#demoModal').modal('show');
		}
		
		function shangchuan(){
			var form = new FormData(document.getElementById("userfile"));
			 form.append("file", form); 
		    $.ajax({  
		         url : "${ctx}/numberinfo/yhcgNumberinfo/file",  
		         type : "POST",  
		         data : form,
		         contentType: false,
		         processData: false,
		         success : function(data) {  
		        	$("#filename").val(data.name);
		        	$("#fileurl").val(data.url);
		        	document.getElementById("sfid").innerHTML=data.name;
		             alert("上传成功");
		         },  
		         error : function(data) {  
		             alert("上传失败");
		         }  
		    });  
		}
		$(function (){
		
			var id=$("#id").val();//获取当前工单id
			 $.ajax({  //获取延期处理信息
		         url : "${ctx}/delay/yhcgDelay/listcha",  
		         type : "POST",  
		         data : {"uid":id},
		         success : function(data) {
		        	 var a='';
		        	 if(data.length>0){
		        			$("#yan1").show();
		        			$("#yan2").show();
		        	  a="<table><tr><td>编号</td><td>申请人</td><td style='width: 100px'>申请原因</td><td>申请日期</td><td>延期天数</td><td>审核状态</td></tr>"
		        	 for(var i=0;i<data.length;i++){
		        		 a +="<tr><td>"+(i+1)+"</td><td>"+data[i].name+"</td><td style=''>"+data[i].reasonsfodelay+""
		        		 +"</td><td>"+data[i].yantime+"</td>"
		        		 +"<td>"+data[i].extensiondays+"</td>"
		        		 var s=null;
		        		 if(data[i].status=="0"){
		        			 s="待审核";
		        		 }else if(data[i].status=="1"){
		        			 s="审核通过";
		        		 }else if(data[i].status=="2"){
		        			 s="审核拒绝";
		        		 }
		        		 a +="<td>"+s+"</td></tr>";
		        	 }
		        	  a +="</table>"
		         }else{
		        	 a ="暂无审核信息";
		         } 
		        	 document.getElementById("yan").innerHTML = a; 
		         }
		    });  
			
			 $.ajax({  //获取处理信息
		         url : "${ctx}/handleinfo/yhcgHandleinfo/listchu",  
		         type : "POST",  
		         data : {"uid":id},
		         success : function(data) {  
		        	 var a=null;
		        	 if(data.length>0){
		        		$("#chu1").show();
		     			$("#chu2").show();
		        	 a="<table><tr><td>编号</td><td>处理人</td><td>处理详情</td><td>处理日期</td><td>附件</td></tr>"
		        	 for(var i=0;i<data.length;i++){//支持以下几种图片展示BMP、JPG、JPEG、PNG、GIF
		        		 a +="<tr><td>"+(i+1)+"</td><td>"+data[i].processingtunit+"</td><td>"+data[i].processingtremark+""
		        		 a +="</td><td>"+data[i].processingtime+"</td>"
		        		 if(typeof(value)!="undefined"){
		        		 if((data[i].filechuname).indexOf("bmp")>-1||(data[i].filechuname).indexOf("jpg")>-1
		        				 ||(data[i].filechuname).indexOf("jpec")>-1||(data[i].filechuname).indexOf("png")>-1
		        				 ||(data[i].filechuname).indexOf("gif")>-1){
		        		 a += "<td><a onclick=jq('"+data[i].id+"')><img style='width: 50px;height: 50px'src='${ctx}/numberinfo/yhcgNumberinfo/uploadhuixian?url="+data[i].id+"'/></a></td>"
		        		 }else{
		        			 a += "<td><a onclick=jq('"+data[i].id+"')>"+data[i].filechuname+"</a></td>"
		        		 } 
		        		 }else{
		        			 a +="<td></td>" 
		        		 }
		        		 a +="</tr>"
		        	 }
		        	  a +="</table>"
		        		 
		         } else{
		        	 a="暂无处理信息"
		         }
		        	 document.getElementById("chuid").innerHTML = a; 
		         }
		    });  
			 
			 $.ajax({  //复查驳回信息
		         url : "${ctx}/recheandrejec/yhcgRecheckandrejec/listbo",  
		         type : "POST",  
		         data : {"uid":id},
		         success : function(data) { 
		        	 var a=null;
		        	 if(data.length>0){
		        		$("#bo1").show();
		     			$("#bo2").show();
		        	 a="<table><tr><td>编号</td><td>驳回人</td><td>驳回原因</td><td>驳回日期</td></tr>"
		        	 for(var i=0;i<data.length;i++){
		        		 a +="<tr><td>"+[i+1]+"</td><td>"+data[i].reviewuser+"</td><td>"+data[i].reviewproposal+""
		        		 +"</td><td>"+data[i].reviewtime+"</td>"
		        		 +"</tr>"
		        	 }
		        	  a +="</table>"
		         } else{
		            a="暂无驳回信息";
		         }
		        	 document.getElementById("boid").innerHTML = a; 
		         }
		    });  
			 $.ajax({  //复查通过信息
		         url : "${ctx}/recheandrejec/yhcgRecheckandrejec/listtong",  
		         type : "POST",  
		         data : {"uid":id},
		         success : function(data) {
		        	 var a=null;
		        	 if(data.length>0){
		        		$("#fu1").show();
		     			$("#fu2").show();
		        	 a="<table><tr><td>编号</td><td>复查人</td><td>复查建议</td><td>复查日期</td></tr>"
		        	 for(var i=0;i<data.length;i++){
		        		 a +="<tr><td>"+[i+1]+"</td><td>"+data[i].reviewuser+"</td><td>"+data[i].reviewproposal+""
		        		 +"</td><td>"+data[i].reviewtime+"</td>"
		        		 +"</tr>"
		        	 }
		        	  a +="</table>"
		        		
		         } else{
		        	a="暂无复查信息";
		         }
		        	 document.getElementById("tongid").innerHTML = a; 
		         }
		         
		    });  
			 $.ajax({  //结案驳回信息
		         url : "${ctx}/dismissthecase/yhcgDismissthecase/listbo",  
		         type : "POST",  
		         data : {"uid":id},
		         success : function(data) {
		        	 var a=null;
		        	 if(data.length>0){
		        		$("#jiebo1").show();
		     			$("#jiebo2").show();
		        	 a="<table><tr><td>编号</td><td>驳回人</td><td>驳回原因</td><td>驳回日期</td></tr>"
		        	 for(var i=0;i<data.length;i++){
		        		 a +="<tr><td>"+[i+1]+"</td><td>"+data[i].closeduser+"</td><td>"+data[i].closedproposal+""
		        		 +"</td><td>"+data[i].closedtime+"</td>"
		        		 +"</tr>"
		        	 }
		        	  a +="</table>"
		        		
		         } else{
		        	a="暂无结案驳回信息";
		         }
		        	 document.getElementById("jieidbo").innerHTML = a; 
		         }
		         
		    });  
			 $.ajax({  //结案信息
		         url : "${ctx}/dismissthecase/yhcgDismissthecase/listjie",  
		         type : "POST",  
		         data : {"uid":id},
		         success : function(data) {
		        	 var a=null;
		        	 if(data.length>0){
		        		 $("#jiean1").show();
		     			$("#jiean2").show();
		        	 a="<table><tr><td>编号</td><td>结案人</td><td>结案建议</td><td>结案日期</td>"
		        	 for(var i=0;i<data.length;i++){
		        		 a +="<tr><td>"+[i+1]+"</td><td>"+data[i].closeduser+"</td><td>"+data[i].closedproposal+""
		        		 +"</td><td>"+data[i].closedtime+"</td>"
		        		 +"</tr>"
		        	 }
		        	  a +="</table>"
		        		
		         } else{
		        	a="暂无结案信息";
		         }
		        	 document.getElementById("jieidbotong").innerHTML = a; 
		         }
		         
		    });
		})
			function jq(url){
			 location.href="${ctx}/numberinfo/yhcgNumberinfo/upload?url="+url; 
		}
		function dayin(){
			  bdhtml=window.document.body.innerHTML;    
		        sprnstr="<!--startprint-->";    
		        eprnstr="<!--endprint-->";    
		        prnhtml=bdhtml.substring(bdhtml.indexOf(sprnstr)+17);    
		        prnhtml=prnhtml.substring(0,prnhtml.indexOf(eprnstr));    
		        window.document.body.innerHTML=prnhtml;    
				window.print(); 
				location.reload();
		}
	</script>
	<style type="text/css">
	#cs1,#cs2,#tid1,#tid2,#tid3,#tid4,.input-medium{
	width: 60%
	}
	
	#tid{
	width: 25%
	}
	</style>
</head>
<body>
<div>
	<form:form id="inputForm" modelAttribute="yhcgNumberinfo" action="${ctx}/numberinfo/yhcgNumberinfo/save" method="post" class="form-horizontal">
		<form:hidden path="id"/>
		<sys:message content="${message}"/>	
		<!--startprint-->
		<table class="table table-striped table-bordered table-condensed">
		<tr><td colspan="2"><h4 style="color: blue;font-size: 16px;padding-left: 3%">【联系人信息】</h4></td></tr>
		<tr><td>
		<div class="control-group">
			<label class="control-label">姓名：</label>
			<div class="controls">
				${yhcgNumberinfo.name}
			<%-- 	<form:input path="name" htmlEscape="false" maxlength="255" class="input-xlarge required"/> --%>
			</div>
		</div>
		</td>
		<td>
		<div class="control-group">
			<label class="control-label">电话：</label>
			<div class="controls">
			${yhcgNumberinfo.phone}
				<%-- <form:input path="phone" htmlEscape="false" maxlength="255" class="input-xlarge required"/> --%>
			</div>
		</div>
		</td>
		</tr>
			<tr><td colspan="2"><h4 style="color: blue;font-size: 16px;padding-left: 3%">【内容描述】</h4></td></tr>
		<tr>
		<td>
		<div class="control-group">
			<label class="control-label">来源：</label>
			<div class="controls">
			${fns:getDictLabel(yhcgNumberinfo.come, 'come_type', '')}
			<%-- <form:select path="come" class="input-medium required"   type="select[disabled]">
					<form:options items="${fns:getDictList('come_type')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select> --%>
			</div>
		</div>
		</td>
		<td>
		<div class="control-group">
			<label class="control-label">事件类别：</label>
			<div class="controls">
			${fns:getDictLabel(yhcgNumberinfo.type, 'type_type', '')}
			</div>
		</div>
		</td>
		
		</tr>
		<tr>
		<td colspan="2">
		<div class="control-group">
			<label class="control-label">附件：</label>
			<div class="controls">
			${yhcgNumberinfo.filename}
			<%-- 	<form:hidden path="filename" htmlEscape="false" maxlength="255" class="input-xlarge" />
				<form:hidden path="fileurl" htmlEscape="false" maxlength="255" class="input-xlarge" />
				<input id="btnSubmitshang" class="btn btn-primary" type="button" value="附件上传" onclick="shang()"/>
				<span id="sfid">
				${name}
				</span> --%>
			</div>
		</div>
		</td>
		</tr>
		<tr>
		<td colspan="4">
			<div class="control-group">
			<label class="control-label">内容：</label>
			<div class="controls">
			${yhcgNumberinfo.content}
				<%-- <form:textarea path="content" htmlEscape="false" rows="6" class="input-xxlarge" id="cs1"/>
				<span><font color="red">*不能大于1500字</font></span> --%>
			</div>
		</div>
		</td>
		
		<tr>
		<td colspan="4">
		<div class="control-group">
			<label class="control-label">备注：</label>
			<div class="controls">
			${yhcgNumberinfo.remark}
			<%-- <form:textarea path="remark" htmlEscape="false" rows="6" class="input-xxlarge" id="cs2"/>
				<span><font color="red">*不能大于1500字</font></span> --%>
			</div>
		</div>
		</td>
		</tr>
		<tr>
		<td>
		<div class="control-group">
			<label class="control-label">登记人：</label>
			<div class="controls">
			${yhcgNumberinfo.registrant}
				<%-- <form:input path="registrant" htmlEscape="false" maxlength="255" class="input-xlarge required"/> --%>
			</div>
		</div>
	
		</td>
		<td>
		<div class="control-group">
			<label class="control-label">办理人：</label>
			<div class="controls"> 
			${yhcgNumberinfo.administrator}
				<%-- <form:input path="administrator" htmlEscape="false" maxlength="255"   class="input-xlarge required" onfocus="this.blur()" value="${fns:getUser().name}" id="did"/> --%>
			</div>
		</div>
		</td>
		</tr>
		<tr>
		<td colspan="2">
		<div class="control-group">
			<label class="control-label">办理期限：</label>
			<div class="controls">
				<fmt:formatDate value="${yhcgNumberinfo.timelimit}" pattern="yyyy-MM-dd HH:mm:ss"/>
			<%-- 	<input name="timelimit" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate required"
					value="<fmt:formatDate value="${yhcgNumberinfo.timelimit}" pattern="yyyy-MM-dd HH:mm:ss"/>"
					onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});" id="tid"/> --%>
			</div>
		</div>
		</td>
		</tr>
		<tr><td colspan="2"><h4 style="color: blue;font-size: 16px;padding-left: 3%">【分流派遣】</h4></td></tr>
		
		<tr>
		<td>
		<div class="control-group">
			<label class="control-label">责任单位：</label>
			<div class="controls">
			${yhcgNumberinfo.zenname}
				<%-- <form:select  path="responsibilityunit" class="input-medium" >
					<form:options items="${list}" itemLabel="name" itemValue="id" htmlEscape="false"/>
				</form:select> --%>
				<%-- <form:input path="responsibilityunit" htmlEscape="false" maxlength="255" class="input-xlarge "/> --%>
			</div>
		</div>
		</td>
		<td>
		<div class="control-group">
			<label class="control-label">督办单位：</label>
			<div class="controls">
			${yhcgNumberinfo.duname}
			<%-- 	<form:select  path="supervisionunit" class="input-medium" >
					<form:options items="${list1}" itemLabel="name" itemValue="id" htmlEscape="false"/>
				</form:select> --%>
			<%-- <form:select path="supervisionunit" class="input-medium required">
					<form:options items="${list1}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select> --%>
				<%-- <form:input path="supervisionunit" htmlEscape="false" maxlength="255" class="input-xlarge "/> --%>
			</div>
		</div>
		</td>
		</tr>
		<tr><td colspan="2"><h4 style="color: blue;font-size: 16px;padding-left: 3%">【延期信息】</h4></td></tr>
		<tr>
		<td colspan="2">
		<div class="control-group">
			<label class="control-label">延期信息：</label>
			<div class="controls" id="yan">
			</div>
		</div>
		</td>
		</tr>
		<tr><td colspan="2"><h4 style="color: blue;font-size: 16px;padding-left: 3%">【处理信息】</h4></td></tr>
		<tr>
		<td colspan="2">
		<div class="control-group">
			<label class="control-label">处理信息：</label>
			<div class="controls"id="chuid">
			</div>
		</div>
		</td>
		</tr>
		<tr><td colspan="2"><h4 style="color: blue;font-size: 16px;padding-left: 3%">【复查驳回】</h4></td></tr>
		<tr>
		<td colspan="2">
		<div class="control-group">
			<label class="control-label">驳回信息：</label>
			<div class="controls" id="boid">
			</div>
		</div>
		</td>
		</tr>
		<tr><td colspan="2"><h4 style="color: blue;font-size: 16px;padding-left: 3%">【复查信息】</h4></td></tr>
		<tr>
		<td colspan="2">
		<div class="control-group">
			<label class="control-label">复查信息：</label>
			<div class="controls" id="tongid">
			</div>
		</div>
		</td>
		</tr>
		<tr><td colspan="2"><h4 style="color: blue;font-size: 16px;padding-left: 3%">【结案驳回】</h4></td></tr>
		<tr>
		<td colspan="2">
		<div class="control-group">
			<label class="control-label">结案驳回：</label>
			<div class="controls" id="jieidbo">
			</div>
		</div>
		</td>
		</tr>
		<tr><td colspan="2"><h4 style="color: blue;font-size: 16px;padding-left: 3%">【结案信息】</h4></td></tr>
		<tr>
		<td colspan="2">
		<div class="control-group">
			<label class="control-label">结案信息：</label>
			<div class="controls" id="jieidbotong">
			</div>
		</div>
		</td>
		</tr>
		<tr><td colspan="2"><h4 style="color: blue;font-size: 16px;padding-left: 3%">【扣分信息】</h4></td></tr>
		<tr>
		<td colspan="2">
		<div class="control-group">
			<label class="control-label">扣分信息：</label>
			<div class="controls">
			</div>
		</div>
		</td>
		</tr>
		</table>
		<!--endprint-->
		<div class="form-actions" >
			<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
			 <button type="button" class="btn btn-primary"  onclick="dayin()" >打印</button>
		</div>
	</form:form>
	</div>
</body>
</html>